package com.qf.fanwang.pojo;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;

public class User1 {
    private Set<Address> setAddrs;
    private Address[] arrayAddres;
    private Map<Integer,Address> mapAddress;
private String name;

    public void setName(String name) {
        System.out.println("setter 方法");
        this.name = name;
    }

    public Set<Address> getSetAddrs() {
        return setAddrs;
    }

    public void setSetAddrs(Set<Address> setAddrs) {
        this.setAddrs = setAddrs;
    }

    public Address[] getArrayAddres() {
        return arrayAddres;
    }

    public void setArrayAddres(Address[] arrayAddres) {
        this.arrayAddres = arrayAddres;
    }

    public Map<Integer, Address> getMapAddress() {
        return mapAddress;
    }

    public void setMapAddress(Map<Integer, Address> mapAddress) {
        this.mapAddress = mapAddress;
    }

    @Override
    public String toString() {
        return "User1{" +
                "setAddrs=" + setAddrs +
                ", arrayAddres=" + Arrays.toString(arrayAddres) +
                ", mapAddress=" + mapAddress +
                '}';
    }

    public User1() {
        System.out.println("无参构造");
    }

    public User1(Set<Address> setAddrs, Address[] arrayAddres, Map<Integer, Address> mapAddress) {
        this.setAddrs = setAddrs;
        this.arrayAddres = arrayAddres;
        this.mapAddress = mapAddress;
    }
    @PostConstruct
    public void init(){
        System.out.println("init methhod");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("destroy method");
    }
}
